﻿
<%@ Page Language="C#" Theme="Default" MasterPageFile="~/MasterPages/admin.master" AutoEventWireup="true"  CodeFile="Sua.aspx.cs" Inherits="Sua" Title="Sua List" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Sua List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" PersistenceMethod="Session" />
		<br />
		<data:EntityGridView ID="GridView1" runat="server"			
				AutoGenerateColumns="False"					
				OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
				DataSourceID="SuaDataSource"
				DataKeyNames="MaSua"
				AllowMultiColumnSorting="false"
				DefaultSortColumnName="" 
				DefaultSortDirection="Ascending"	
				ExcelExportFileName="Export_Sua.xls"  		
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" ShowEditButton="True" />				
				<asp:BoundField DataField="TenSua" HeaderText="Ten Sua" SortExpression="[TenSua]"  />
				<asp:BoundField DataField="GiaNhap" HeaderText="Gia Nhap" SortExpression="[GiaNhap]"  />
				<asp:BoundField DataField="GiaTrenBaoBi" HeaderText="Gia Tren Bao Bi" SortExpression="[GiaTrenBaoBi]"  />
				<asp:BoundField DataField="GiaBan" HeaderText="Gia Ban" SortExpression="[GiaBan]"  />
				<asp:BoundField DataField="HinhAnh" HeaderText="Hinh Anh" SortExpression="[HinhAnh]"  />
				<asp:BoundField DataField="ThongTin" HeaderText="Thong Tin" SortExpression="[ThongTin]"  />
				<data:HyperLinkField HeaderText="Ma Loai" DataNavigateUrlFormatString="LoaiSuaEdit.aspx?MaLoai={0}" DataNavigateUrlFields="MaLoai" DataContainer="MaLoaiSource" DataTextField="TenLoai" />
				<data:HyperLinkField HeaderText="Ma Nsx" DataNavigateUrlFormatString="NhaSanXuatEdit.aspx?MaNsx={0}" DataNavigateUrlFields="MaNsx" DataContainer="MaNsxSource" DataTextField="TenNsx" />
				<asp:BoundField DataField="SoLuong" HeaderText="So Luong" SortExpression="[SoLuong]"  />
			</Columns>
			<EmptyDataTemplate>
				<b>No Sua Found!</b>
			</EmptyDataTemplate>
		</data:EntityGridView>
		<br />
		<asp:Button runat="server" ID="btnSua" OnClientClick="javascript:location.href='SuaEdit.aspx'; return false;" Text="Add New"></asp:Button>
		<data:SuaDataSource ID="SuaDataSource" runat="server"
			SelectMethod="GetPaged"
			EnablePaging="True"
			EnableSorting="True"
			EnableDeepLoad="True"
			>
			<DeepLoadProperties Method="IncludeChildren" Recursive="False">
	            <Types>
					<data:SuaProperty Name="LoaiSua"/> 
					<data:SuaProperty Name="NhaSanXuat"/> 
					<%--<data:SuaProperty Name="AnhChiTietCollection" />--%>
				</Types>
			</DeepLoadProperties>
			<Parameters>
				<data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" />
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" />
				<asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex" Type="Int32" />
				<asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize" Type="Int32" />
				<data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
			</Parameters>
		</data:SuaDataSource>
	    		
</asp:Content>



